/***********************************************
/gen auto by zuitools
***********************************************/
#ifndef __VALVEACTIVITY_H__
#define __VALVEACTIVITY_H__


#include "app/Activity.h"
#include "entry/EasyUIContext.h"

#include "uart/ProtocolData.h"
#include "uart/ProtocolParser.h"

#include "utils/Log.h"
#include "control/ZKDigitalClock.h"
#include "control/ZKButton.h"
#include "control/ZKCircleBar.h"
#include "control/ZKDiagram.h"
#include "control/ZKListView.h"
#include "control/ZKPointer.h"
#include "control/ZKQRCode.h"
#include "control/ZKTextView.h"
#include "control/ZKSeekBar.h"
#include "control/ZKEditText.h"
#include "control/ZKVideoView.h"
#include "window/ZKSlideWindow.h"

/*TAG:Macro宏ID*/
#define ID_VALVE_Button45    20042
#define ID_VALVE_Button46    20041
#define ID_VALVE_Button47    20038
#define ID_VALVE_TextView17    50017
#define ID_VALVE_Button36    20036
#define ID_VALVE_Button35    20035
#define ID_VALVE_Button34    20034
#define ID_VALVE_Button33    20033
#define ID_VALVE_Button32    20032
#define ID_VALVE_Button31    20031
#define ID_VALVE_Button30    20030
#define ID_VALVE_Button29    20029
#define ID_VALVE_Button28    20028
#define ID_VALVE_Button27    20027
#define ID_VALVE_Button26    20026
#define ID_VALVE_Button25    20025
#define ID_VALVE_Button24    20024
#define ID_VALVE_TextView16    50016
#define ID_VALVE_Window1    110001
#define ID_VALVE_TextView12    50012
#define ID_VALVE_Button43    20043
#define ID_VALVE_Button5    20005
#define ID_VALVE_Button16    20016
#define ID_VALVE_TextView3    50003
#define ID_VALVE_EditText2    51002
#define ID_VALVE_Button40    20040
#define ID_VALVE_Button20    20020
#define ID_VALVE_Button14    20014
#define ID_VALVE_EditText1    51001
#define ID_VALVE_TextView10    50010
#define ID_VALVE_TextView28    50028
#define ID_VALVE_TextView5    50005
#define ID_VALVE_Button1    20001
#define ID_VALVE_TextView4    50004
#define ID_VALVE_Button22    20022
#define ID_VALVE_Button17    20017
#define ID_VALVE_TextView15    50015
#define ID_VALVE_Button13    20013
#define ID_VALVE_Button15    20015
#define ID_VALVE_Button9    20009
#define ID_VALVE_TextView1    50001
#define ID_VALVE_Button12    20012
#define ID_VALVE_TextView9    50009
#define ID_VALVE_Button4    20004
#define ID_VALVE_Button8    20008
#define ID_VALVE_Button21    20021
#define ID_VALVE_Button39    20039
#define ID_VALVE_Button18    20018
#define ID_VALVE_Button3    20003
#define ID_VALVE_Button6    20006
#define ID_VALVE_TextView27    50027
#define ID_VALVE_TextView14    50014
#define ID_VALVE_TextView13    50013
#define ID_VALVE_Button7    20007
#define ID_VALVE_TextView7    50007
#define ID_VALVE_TextView26    50026
#define ID_VALVE_TextView11    50011
#define ID_VALVE_Button10    20010
#define ID_VALVE_Button2    20002
#define ID_VALVE_Button23    20023
#define ID_VALVE_TextView8    50008
#define ID_VALVE_Button37    20037
#define ID_VALVE_Button19    20019
#define ID_VALVE_TextView2    50002
#define ID_VALVE_TextView6    50006
#define ID_VALVE_Button11    20011
/*TAG:Macro宏ID END*/

class valveActivity : public Activity, 
                     public ZKSeekBar::ISeekBarChangeListener, 
                     public ZKListView::IItemClickListener,
                     public ZKListView::AbsListAdapter,
                     public ZKSlideWindow::ISlideItemClickListener,
                     public EasyUIContext::ITouchListener,
                     public ZKEditText::ITextChangeListener,
                     public ZKVideoView::IVideoPlayerMessageListener
{
public:
    valveActivity();
    virtual ~valveActivity();

    /**
     * 注册定时器
     */
	void registerUserTimer(int id, int time);
	/**
	 * 取消定时器
	 */
	void unregisterUserTimer(int id);
	/**
	 * 重置定时器
	 */
	void resetUserTimer(int id, int time);

protected:
    /*TAG:PROTECTED_FUNCTION*/
    virtual const char* getAppName() const;
    virtual void onCreate();
    virtual void onClick(ZKBase *pBase);
    virtual void onResume();
    virtual void onPause();
    virtual void onIntent(const Intent *intentPtr);
    virtual bool onTimer(int id);

    virtual void onProgressChanged(ZKSeekBar *pSeekBar, int progress);

    virtual int getListItemCount(const ZKListView *pListView) const;
    virtual void obtainListItemData(ZKListView *pListView, ZKListView::ZKListItem *pListItem, int index);
    virtual void onItemClick(ZKListView *pListView, int index, int subItemIndex);

    virtual void onSlideItemClick(ZKSlideWindow *pSlideWindow, int index);

    virtual bool onTouchEvent(const MotionEvent &ev);

    virtual void onTextChanged(ZKTextView *pTextView, const string &text);

    void rigesterActivityTimer();

    virtual void onVideoPlayerMessage(ZKVideoView *pVideoView, int msg);
    void videoLoopPlayback(ZKVideoView *pVideoView, int msg, size_t callbackTabIndex);
    void startVideoLoopPlayback();
    void stopVideoLoopPlayback();
    bool parseVideoFileList(const char *pFileListPath, std::vector<string>& mediaFileList);
    int removeCharFromString(string& nString, char c);


private:
    /*TAG:PRIVATE_VARIABLE*/
    int mVideoLoopIndex;
    int mVideoLoopErrorCount;

};

#endif